package com.example.java.sink;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class SinkToMysqlMain {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        DataStreamSource<Student> data = env.fromElements(
                new Student(1,"zhangsan",18),
                new Student(2,"lisi",19),
                new Student(3,"wangwu",20));

        data.addSink(new MysqlSink());
        env.execute();
    }
}
